class ModifyOffers < ActiveRecord::Migration
  def self.up
   # remove_index :offers, :offer_from_id
   # remove_index :offers, :offer_to_id
   
    remove_column :offers, :offer_to_id
    remove_column :offers, :offer_from_id
    
    add_column :offers, :for_book_id, :integer
    add_column :offers, :offer_book_id, :integer
    add_column :offers, :status, :integer

    #NEED HELP!
    #this is where I need a foreign key to the book table.
    add_index :offers, :for_book_id
    add_index :offers, :offer_book_id
  
    
  end

  def self.down
    add_column :offers, :offer_to_id, :integer
    add_column :offers, :offer_from_id, :integer
    
    remove_index :offers, :for_book_id
    remove_index :offers, :offer_book_id
    
    remove_column :offers, :for_book_id 
    remove_column :offers, :offer_book_id
    remove_column :offers, :status
  
    
    add_index :offers, :offer_from_id
    add_index :offers, :offer_to_id
  end
end
